package cl.ncx.cmvrc.persistence.base.entities.log;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * LogMetadata entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "log_metadata", schema = "base")
@SequenceGenerator(name = "log_metadata_seque", sequenceName = "base.log_metadata_id_seq")
public class LogMetadata implements java.io.Serializable {

	// Fields

	private Long logMetadataId;
	private Log log;
	private String nombre;
	private String valor;

	// Constructors

	/** default constructor */
	public LogMetadata() {
	}

	/** minimal constructor */
	public LogMetadata(Long logMetadataId, Log log, String nombre) {
		this.logMetadataId = logMetadataId;
		this.log = log;
		this.nombre = nombre;
	}

	/** full constructor */
	public LogMetadata(Long logMetadataId, Log log, String nombre, String valor) {
		this.logMetadataId = logMetadataId;
		this.log = log;
		this.nombre = nombre;
		this.valor = valor;
	}

	// Property accessors
	@Id
	@Column(name = "log_metadata_id", unique = true, nullable = false)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "log_metadata_seque")
	public Long getLogMetadataId() {
		return this.logMetadataId;
	}

	public void setLogMetadataId(Long logMetadataId) {
		this.logMetadataId = logMetadataId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "log_id", nullable = false)
	public Log getLog() {
		return this.log;
	}

	public void setLog(Log log) {
		this.log = log;
	}

	@Column(name = "nombre", nullable = false)
	public String getNombre() {
		return this.nombre;
	}

	public void setNombre(String nombre) {
		this.nombre = nombre;
	}

	@Column(name = "valor")
	public String getValor() {
		return this.valor;
	}

	public void setValor(String valor) {
		this.valor = valor;
	}

}